package com.lengxf.design;

import java.io.IOException;

public class Client {

    public static void main(String[] args) throws IOException, ClassNotFoundException {
        WeeklyLog log_previous, log_new;
        log_previous = new WeeklyLog();
        Attachment attachment = new Attachment();
        log_previous.setAttachment(attachment);
        log_new = log_previous.deepClone();


        PrototypeManager.add("log_previous", log_previous);


        Prototype logPrevious = PrototypeManager.get("log_previous");
        WeeklyLog newWeeklyLog = (WeeklyLog) PrototypeManager.get("log_previous");

        System.out.println("周报是否相同？" + (log_previous == log_new));
        System.out.println("附件是否相同？" + (log_previous.getAttachment() == log_new.getAttachment()));


        System.out.println("2.周报是否相同？" + (log_previous == newWeeklyLog));
        System.out.println("2.附件是否相同？" + (log_previous.getAttachment() == newWeeklyLog.getAttachment()));

    }
}
